/*
 * @Author: 1453937336@qq.com 1453937336@qq.com
 * @Date: 2024-05-08 18:13:57
 * @LastEditors: 1453937336@qq.com 1453937336@qq.com
 * @LastEditTime: 2024-06-24 19:44:18
 * @FilePath: \itforce-hris\src\api\workInfo\workInfo.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import service from '@/utils/request';
import { findUrl } from '../globleApiSetting/globleApiSetting';
const apiName = 'workInfo'




/**
 * 查询员工工作信息
 * @param params 
 * @returns 
 */
export function GetWorkInfoList(params: any) {
    const api = findUrl(apiName, '/itf/employee/web/work_info');
    return service({
        url: api?.selectApis,
        method: api?.methods,
        params
    })

}


/**
 * 新增员工工作信息
 * @param data 
 * @returns 
 */
export function AddWorkInfo(data: any) {
    const api = findUrl(apiName, "/itf/employee/web/position/assignment");
    return service({
        url: api?.selectApis,
        method: 'POST',
        data
    })

}


/**
 * 删除员工工作信息职位分配
 * @param data 
 * @returns 
 */
export function DeletedWorkInfo(uuid: any) {
    const api = findUrl(apiName, '/itf/employee/web/position/assignment/uuid');
    return service({
        url: api?.selectApis + uuid,
        method: 'DELETE',
    })

}

/**
 * 根据uuid查询员工工作详情信息
 * @param params 
 * @returns 
 */
export function GetDetailWorkInfoByUuid(uuid: any) {
    // const api = findUrl(apiName, '/itf/employee/web/work_info/uuid');
    return service({
        url: `/itf/employee/web/work_info/uuid/${uuid}`,
        method: 'get',
    })

}

/**
 * 员工职位分配
 * @param params 
 * @returns 
 */
export function GetpositionAssignment(params: any) {
    return service({
        url: '/itf/employee/web/position/assignment',
        method: 'get',
        params
    })
}

/**
 * 查询员工工作信息
 * @param params 
 * @returns 
 */
export function GetDetailWorkInfo(employeeId: any, params: any) {
    return service({
        url: '/itf/employee/web/work_info/by_employee_id/' + employeeId,
        method: 'get',
        params
    })

}

/**
 * 新增员工工作信息
 * @param params 
 * @returns 
 */
export function PostWorkInfo(data: any) {
    return service({
        url: '/itf/employee/web/work_info',
        method: 'post',
        data
    })
}

/**
 * 根据uuid修改
 * @param params 
 * @returns 
 */
export function PutWorkInfoUpdate(data: any) {
    return service({
        url: '/itf/employee/web/work_info/uuid/' + data.uuid,
        method: 'put',
        data
    })

}

/**
 * 员工岗位历史记录
 * @param params 
 * @returns 
 */
export function GetPositionHistoryPage(params: any) {
    return service({
        url: '/itf/employee/web/position/history/page',
        method: 'get',
        params
    })
}

/**
 * 新增员工批量分配
 * @param params 
 * @returns 
 */
export function PostWorkInfoPositionBatch(data: any) {
    return service({
        url: '/itf/employee/web/position/assignment/batch',
        method: 'post',
        data
    })
}